package cn.fl.mcr.transform;

import java.util.ArrayList;
import java.util.List;

import cn.cmm.base.framework.utils.CollectionUtils;
import cn.lionbridgecapital.loan.model.dto.McrWriteOffPushDetailDTO;
import cn.lionbridgecapital.loan.model.vo.McrWriteOffPushDetailVO;


 /**
 * @Description: 核销推送明细 转换器
 * @Description: VO是客户端传递数据到服务端进行转换的数据 
 * @Description: VO转换数据变成DTO传递到服务端 
 * @Description: VO不能在服务端出现
 */
public class McrWriteOffPushDetailVOTransform {


	/**
	 * DTO 转  VO
	 * @param po McrWriteOffPushDetailDTO
	 * @return McrWriteOffPushDetailVO
	 */
	public static McrWriteOffPushDetailVO toVO(McrWriteOffPushDetailDTO dto) {
		McrWriteOffPushDetailVO  vo = null;
		if (dto != null) { 
			vo = new McrWriteOffPushDetailVO();
			vo.setId(dto.getId());
			vo.setBatNo(dto.getBatNo());//核销推送批次号
			vo.setCommitTm(dto.getCommitTm());//提交时间
			vo.setRepayAcc(dto.getRepayAcc());//我司还款账户
			vo.setBankNo(dto.getBankNo());//银行流水号
			vo.setRepayDate(dto.getRepayDate());//打款日期
			vo.setRepayMoney(dto.getRepayMoney());//打款金额
			vo.setRepayMoneyRemark(dto.getRepayMoneyRemark());//备注线下还款标识
			vo.setCommitType(dto.getCommitType());//状态 -1:提交失败,0:待确认提交,1:提交成功
			vo.setRepayAmt(dto.getRepayAmt());//REPAY_AMT
			vo.setRepayPrincipal(dto.getRepayPrincipal());//REPAY_PRINCIPAL
			vo.setRepayInterest(dto.getRepayInterest());//REPAY_INTEREST
			vo.setRepayPenaltyInterest(dto.getRepayPenaltyInterest());//REPAY_PENALTY_INTEREST
			vo.setRepayNum(dto.getRepayNum());//REPAY_NUM
			vo.setFailReason(dto.getFailReason());
			vo.setRepayBatNos(dto.getRepayBatNos());

			vo.setCrtTm(dto.getCrtTm());//创建时间
			vo.setCrtUsrId(dto.getCrtUsrId());//创建人
			vo.setMdfTm(dto.getMdfTm());//修改时间
			vo.setMdfUsrId(dto.getMdfUsrId());//修改人
		}
		return vo;
	}

	/**
	 * VO 转 DTO
	 * @param dto McrWriteOffPushDetailVO
	 * @return McrWriteOffPushDetailDTO
	 */
	public static McrWriteOffPushDetailDTO toDTO(McrWriteOffPushDetailVO vo) {
		McrWriteOffPushDetailDTO dto = null;
		if (vo != null) {
			dto = new McrWriteOffPushDetailDTO();
			dto.setId(vo.getId());
			dto.setBatNo(vo.getBatNo());//核销推送批次号
			dto.setCommitTm(vo.getCommitTm());//提交时间
			dto.setRepayAcc(vo.getRepayAcc());//我司还款账户
			dto.setBankNo(vo.getBankNo());//银行流水号
			dto.setRepayDate(vo.getRepayDate());//打款日期
			dto.setRepayMoney(vo.getRepayMoney());//打款金额
			dto.setRepayMoneyRemark(vo.getRepayMoneyRemark());//备注线下还款标识
			dto.setCommitType(vo.getCommitType());//状态 -1:提交失败,0:待确认提交,1:提交成功
			dto.setRepayAmt(vo.getRepayAmt());//REPAY_AMT
			dto.setRepayPrincipal(vo.getRepayPrincipal());//REPAY_PRINCIPAL
			dto.setRepayInterest(vo.getRepayInterest());//REPAY_INTEREST
			dto.setRepayPenaltyInterest(vo.getRepayPenaltyInterest());//REPAY_PENALTY_INTEREST
			dto.setRepayNum(vo.getRepayNum());//REPAY_NUM
			dto.setFailReason(vo.getFailReason());
			dto.setRepayBatNos(vo.getRepayBatNos());
			
			dto.setCrtTm(vo.getCrtTm());//创建时间
			dto.setCrtUsrId(vo.getCrtUsrId());//创建人
			dto.setMdfTm(vo.getMdfTm());//修改时间
			dto.setMdfUsrId(vo.getMdfUsrId());//修改人
		}
		return dto;
	}
	
	/**
	 * DTO集合 转 VO集合
	 * @param List<McrWriteOffPushDetailDTO>
	 * @return List<McrWriteOffPushDetailVO>
	 */
	public static List<McrWriteOffPushDetailVO> toVOList(List<McrWriteOffPushDetailDTO> list) {
		List<McrWriteOffPushDetailVO>  voList = new ArrayList<McrWriteOffPushDetailVO>();
		if(CollectionUtils.isNotEmpty(list)){
			for (McrWriteOffPushDetailDTO dto : list) {
				voList.add(toVO(dto));
			}
		}
		return voList;
	}
	
	/**
	 * VO集合 转 DTO集合
	 * @param list List<McrWriteOffPushDetailVO>
	 * @return List<McrWriteOffPushDetailDTO>
	 */
	public static List<McrWriteOffPushDetailDTO> toDTOList(List<McrWriteOffPushDetailVO> list) {
		List<McrWriteOffPushDetailDTO>  dtoList = new ArrayList<McrWriteOffPushDetailDTO>();
		if(CollectionUtils.isNotEmpty(list)){
			for (McrWriteOffPushDetailVO vo : list) {
				dtoList.add(toDTO(vo));
			}
		}
		return dtoList;
	}
}
